<%@ page language="java" import="dao.*" pageEncoding="UTF-8" %>
 <%@ page language="java" import="java.util.*" %>
 <%@page import="util.*" %>
<%
String orderId = Request.get("order", "id");
String sortId = Request.get("sort", "desc");
util.Execl xls = new util.Execl();
xls.addCol("id", "ID");

xls.addCol("xuehao", "学号");

xls.addCol("xingming", "姓名");

xls.addCol("ruxueshijian", "入学时间");

xls.addColSelect("xueqi", "学期", "xueqixinxi", "id", "xueqimingcheng", 0);

xls.addColSelect("banji", "班级", "banjixinxi", "id", "banjimingcheng", 0);

xls.addCol("biandongzhuangtai", "变动状态");

xls.addCol("biandongyuanyin", "变动原因");

xls.addCol("caozuoren", "教师");

xls.addCol("addtime", "变动时间");

// 下面是数据，数据需要经过处理
String where = " 1=1 ";

if (request.getParameter("xuejixinxiid") != null && !"".equals(request.getParameter("xuejixinxiid"))) {
    where += " AND xuejixinxiid='" + request.getParameter("xuejixinxiid") + "' ";
}
if (request.getParameter("xuehao") != null && !"".equals(request.getParameter("xuehao"))) {
    where += " AND xuehao LIKE '%" + request.getParameter("xuehao") + "%'";
}
if (request.getParameter("xueqi") != null && !"".equals(request.getParameter("xueqi"))) {
    where += " AND xueqi ='" + request.getParameter("xueqi") + "'";
}
if (request.getParameter("banji") != null && !"".equals(request.getParameter("banji"))) {
    where += " AND banji ='" + request.getParameter("banji") + "'";
}
if (request.getParameter("biandongzhuangtai") != null && !"".equals(request.getParameter("biandongzhuangtai"))) {
    where += " AND biandongzhuangtai ='" + request.getParameter("biandongzhuangtai") + "'";
}
if (request.getParameter("biandongyuanyin") != null && !"".equals(request.getParameter("biandongyuanyin"))) {
    where += " AND biandongyuanyin LIKE '%" + request.getParameter("biandongyuanyin") + "%'";
}
List<Map> list = Query.make("xuejibiandong").where(where).order(orderId + " " + sortId).select();

xls.addData(list);
xls.export("xuejibiandong", response);
%>

